{% extends "templates/base.html" %}

{% block title%}Ride Offer{% endblock %}

{% block main %}
	<h2>View Ride Offer</h2>
	
	<!-- start rideoffer -->
	<ul class="details-list">
		<li><strong>Owner</strong> <a href="/profile?user={{ rideoffer.owner.key.id }}">{{ rideoffer.owner.user.email }}</a></li>
		
		<li>
			<strong>From</strong> <a href="/location?id={{ rideoffer.source.key.id }}">{{ rideoffer.source.address }}</a>
			<strong>To</strong> <a href="/location?id={{ rideoffer.destination.key.id }}">{{ rideoffer.destination.address }}</a>
		</li>
		
		{% if rideoffer.notes %}
			<li><strong>Notes</strong><br /> {{ rideoffer.notes }}</li>
		{% endif %}
	</ul>
	<!-- end rideoffer -->
	
	
	<p> <!-- ride -->

	      <h3>Scheduled Rides</h3>
	      <table>
	      	{% for ride in rideoffer.rides %}
			<tr class="row-a">
			  <td><strong>Date</strong> {{ ride.date }}<br />
			  <strong>Departs at</strong> {{ ride.departure_time }} <strong> Arrives at</strong> {{ ride.arrival_time }}</td>
			  <td> <a href="/ride?id={{ ride.key.id }}">View Details</a></td>
			  </tr>
			{% endfor %}
		 </table>

	</p>


{% endblock %}